<!--{!#menu}-->
<!--{!@header_index,header_settings,header_product,header_xcenter,header_cms,header_vip}-->
<?php
$menus = array();
$menus['index'] = array(array('{!menu_home}', '#{/index/home}#'));
foreach($historymenus as $v){
    $menus['index'][] = array($_XT_LANG[$v[0]],xt_uri($v[1]));
}
if(count($menus['index']) > 1) {
	$menus['index'][] = array('{!menu_home_clearhistorymenus}', '#{/index/clear}#',1, 'main', 'class="menulink"');
}

$menus=makemenu($menus,'settings',array(
array('{!menu_settings_basic}', '#{@settings/basic}#'),
array('{!menu_settings_access}', '#{@settings/access}#'),
array('{!menu_settings_optimize}', '#{@settings/seo}#'),
array('{!menu_settings_functions}', '#{@settings/functions}#'),
array('{!menu_settings_credits}', '#{@settings/credits}#'),
array('{!menu_settings_mail}', '#{@settings/mail}#'),
array('{!menu_settings_sec}', '#{@settings/sec}#'),
array('{!menu_settings_datetime}', '#{@settings/datetime}#'),
array('{!menu_settings_attachments}', '#{@settings/attach}#'),
array('{!menu_settings_wap}', '#{@settings/wap}#'),
array('{!menu_settings_uc}', '#{@settings/uc}#'),
array('{!menu_settings_uchome}', '#{@settings/uchome}#'),
));
$menus=makemenu($menus,'vip', array(
   	array('{!menu_nmenbers}', '#{icweb,@/nmenbers}#'),
   	array('{!menu_vmenbers}', '#{icweb,@/vmenbers}#'),
   	array('{!menu_smenbers}', '#{icweb,@/smenbers}#'),
   	array('{!menu_company}', '#{icweb,@/company}#')

));
$menus=makemenu($menus,'product', array(
   	array('{!menu_category}', '#{icweb,@/category}#'),
   	array('{!menu_product}', '#{icweb,@/product}#'),
   	array('menu_forums_merge', 'forums&operation=merge'),
   	array('menu_forums_threadtypes', 'threadtypes'),
   	array('menu_forums_infotypes', 'threadtypes&special=1'),
   	array('menu_forums_infomodel', 'threadtypes&operation=typemodel'),
   	array('menu_forums_infooption', 'threadtypes&operation=typeoption')
));

$menus=makemenu($menus,'cms', array(
   	array('{!menu_cms_all}', '#{icweb,@/cms/all}#'),
   	array('{!menu_cms_inspect}', '#{icweb,@/cms/inspect}#'),
   	array('{!menu_cms_category}', '#{icweb,@/cms/category}#'),
   	array('{!menu_cms_block}', '#{icweb,@/cms/block}#'),
   	array('{!menu_cms_special}', '#{icweb,@/cms/special}#'),
   	array('{!menu_cms_publish}', '#{icweb,@/cms/publish}#'),
   	array('{!menu_cms_news}', '#{icweb,@/cms/news}#'),
   	array('{!menu_cms_image}', '#{icweb,@/cms/image}#')
));
$menus=makemenu($menus,'xcenter', array(
   	array('{!menu_users}', '#{@system/users}#'),
   	array('{!menu_permissions}', '#{@system/resource}#'),
   	array('{!menu_databases}', '#{@database/route}#'),
   	array('{!menu_static}', '#{@system/static}#'),
   	array('menu_members_edit', 'members'),
   	array('menu_members_edit_ban_user', 'members&operation=ban'),
   	array('menu_members_ipban', 'members&operation=ipban'),
   	array('menu_members_credits', 'members&operation=reward'),
   	array('menu_moderate_modmembers', 'moderate&operation=members'),
   	array('menu_profilefields', 'profilefields'),
   	array('menu_admingroups', 'admingroups'),
   	array('menu_usergroups', 'usergroups'),
   	array('menu_ranks', 'ranks')
));

function makemenu($menus,$key,$ms){
    if(is_array($ms)) {
		foreach($ms as $menu) {
			if($menu[0] && $menu[1] && !empty($menu[2])) {
			    if(!isset($menus[$key])) {$menus[$key] = array();}
			    $menus[$key][] = $menu;
			}
		}
	}
    return $menus;
}
function showmenu($key, $menus) {
    if($key=='cms') return;
	echo '<ul id="menu_'.$key.'" style="display: none">';
	if(is_array($menus)) {
		foreach($menus as $menu) {
            echo '<li><a href="##'.$menu[1].'" hidefocus="true" target="'.(empty($menu[3]) ? 'main' : $menu[3]).'"'.(empty($menu[4]) ? '' : $menu[4]).'>'.$menu[0].'</a></li>';
		}
	}
	echo '</ul>';
}
function showheader($key, $url,$titels) { 
	echo '<li><em><a hidefocus="true" href="javascript:;" id="header_'.$key.'" onclick="toggleMenu(\''.$key.'\', \''.$url.'\');">'.$titels['header_'.$key].'</a></em></li>';
}
?>